package com.lzh.persevere.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.lzh.persevere.common.BaseEntity;
import lombok.*;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 文章表(ArticleInfo)实体类
 *
 * @author luzhiheng
 * @since 2025-07-15
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("article_info")
@Builder
@Accessors(chain = true)
@Entity
@Table(name = "article_info", indexes = {})
public class ArticleInfo extends BaseEntity {

    /**
     * 文章分类ID
     */
    @Column(name = "category_id", columnDefinition = "int COMMENT '文章分类ID'")
    private Integer categoryId;

    /**
     * 文章标题
     */
    @Column(name = "title", columnDefinition = "varchar(2048) COMMENT '文章标题'")
    private String title;

    /**
     * markdown内容
     */
    @Column(name = "md_content", columnDefinition = "longtext COMMENT 'markdown内容'")
    private String mdContent;

    /**
     * html内容
     */
    @Column(name = "html_content", columnDefinition = "longtext COMMENT 'html内容'")
    private String htmlContent;


    /**
     * 文章状态:0-草稿,1-发布,2-下架
     */
    @Column(name = "status", columnDefinition = "int COMMENT '文章状态:0-草稿,1-发布,2-下架'")
    private Integer status;

    /**
     * 缩略图
     */
    @Column(name = "thumbnail", columnDefinition = "varchar(2048) COMMENT '缩略图'")
    private String thumbnail;

    /**
     * 评论数
     */
    @Column(name = "comment_count", columnDefinition = "int COMMENT '评论数'")
    private Integer commentCount;

    /**
     * 访问量
     */
    @Column(name = "view_count", columnDefinition = "int DEFAULT 0 COMMENT '访问量'")
    private Integer viewCount;

    /**
     * 收藏数
     */
    @Column(name = "collect_count", columnDefinition = "int DEFAULT 0 COMMENT '收藏数'")
    private Integer collectCount;

    /**
     * 点赞数
     */
    @Column(name = "like_count", columnDefinition = "int DEFAULT 0 COMMENT '点赞数'")
    private Integer likeCount;

    /**
     * 字数统计
     */
    @Column(name = "word_count", columnDefinition = "int DEFAULT 0 COMMENT '字数统计'")
    private Integer wordCount;

    /**
     * 是否置顶：0否 1是
     */
    @Column(name = "is_top", columnDefinition = "tinyint DEFAULT 0 COMMENT '是否置顶：0否 1是'")
    private Integer isTop;

    /**
     * 是否允许评论：0否 1是
     */
    @Column(name = "is_comment", columnDefinition = "tinyint DEFAULT 0 COMMENT '是否允许评论：0否 1是'")
    private Integer isComment;

    /**
     * 备注
     */
    @Column(name = "remark", columnDefinition = "varchar(2048) COMMENT '备注'")
    private String remark;
}

